package p2p.logic.connection.communication;

import java.net.DatagramSocket;

import p2p.logic.connection.ConnectionOwner;

/**
 * 
 * Abstract Communication class - defining basic 
 * properties for a Communication 
 *
 */
public abstract class Communication {
	
	protected ConnectionOwner owner;
	protected DatagramSocket socket;
	protected AbstractCommunicationHandler handler;

	public Communication(AbstractCommunicationHandler handler){
		
		this.handler = handler;
		
	}
	
	public Communication(){
		
	}
		
	public void stop(){
		
		this.socket.close();
		
	}
	
	public void setCommunicationOwner(ConnectionOwner owner){
		
		this.owner = owner;
	
	}

	public ConnectionOwner getConnectionOwner() {
	
		return this.owner;
	
	}
		
	public abstract void start();

}
